<template>
  <div>
    <h2>----------HelloVuex内容----------</h2>
    <h3>{{$store.state.count}}</h3>
    <h3>{{$store.getters.powerCount}}</h3>
    <h3>{{$store.getters.greaterAgesCount}}</h3>
    <h3>{{more20StuAge}}</h3>

    <h3>{{$store.state.info}}</h3>
  </div>
</template>

<script>
export default {
  name:'HelloVuex',
  // props:{
  //   count:Number,
  // },
  computed:{
    more20StuAge(){
      return this.$store.state.students.filter(s=>s.age>=20).length;
    },
  }
}
</script>

<style>

</style>